
public class Point3D {
	
	private double x;
	private double y;
	private double z;
	
	public Point3D(double x, double y, double z){
		setX(x);
		setY(y);
		setZ(z);
	}
	
	public double getDistance(Point3D p){
		double afstand = Math.sqrt(Math.pow(this.getX() - p.getX(), 2) + Math.pow(this.getY() - p.getY(), 2) + Math.pow(this.getZ() - p.getZ(), 2));
		return afstand;
	}

	public double getX() {
		return x;
	}
	
	public double getY() {
		return y;
	}
	
	public double getZ() {
		return z;
	}
	
	private void setX(double x) {
		this.x = x;
	}
	
	private void setY(double y) {
		this.y = y;
	}
	
	public void setZ(double z) {
		this.z = z;
	}
	
	public boolean equals(Point3D p){
		return(this.getX() == p.getX() && this.getY() == p.getY() && this.getZ() == p.getZ());
	}

}
